<style>
    #treeview{
        display: flex;
        flex-direction: column;
    }
    .checkbox_input{
        width: 80%;
        display: flex;
        align-items:center;
    }
    .fields_name{
        border: 1px solid #ccc;
        margin-left: 10px;
        margin-bottom: 10px;
    }
</style>
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <input type="hidden" id="diyform-id" value="{$row.id}">
    <input type="hidden" name="row[table]" id="diyform-table" value="{$row.table}">
    <div class="form-group">
        <label for="c-pid" class="control-label col-xs-12 col-sm-2">{:__('所属图表')}:</label>
        <div class="col-xs-12 col-sm-8">

            <select id="c-pid" data-rule="required" class="form-control selectpicker" name="row[parent_id]">
                {foreach name="parentList" item="vo"}
                <option  value="{$key}" {in name="key" value="$row.parent_id"}selected{/in}>{$vo.name}</option>
                {/foreach}
            </select>

        </div>
    </div>

    <!--选择数据图表-->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('选择数据图表')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select id="c-chart_table_list_id" data-rule="required" class="form-control selectpicker" name="row[chart_table_list_id]">
                {foreach($chart_table_list as $k=>$v)}
                <option  value="{$v['id']}" {if($v['id'] == $row['chart_table_list_id'])} selected {/if}>{$v.table_name_zh}</option>
                {/foreach}
            </select>
        </div>
    </div>

    <!--选中字段-->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('fields')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div id="treeview">
                {foreach $fieldsEditList as $k=>$v}
                <div class="checkbox_input">
                    <div>
                        <input type="checkbox" name="row[{$v['key']}]" id="" value="{$v['key']}" {if($v.as_name)} checked {/if}/>
                        <label>{$v['name']}</label>
                    </div>
                    <div>
                        <input class="fields_name" type="text" name="row[{$v['key']}_as]" value="{$v.as_name}" placeholder="请输入别名">
                    </div>
                </div>
                {/foreach}
            </div>
        </div>
    </div>

    <!--双Y轴数据字段选择-->
    <div class="form-group">
        <label for="c-y_axial_2" class="control-label col-xs-12 col-sm-2">{:__('双Y轴数据字段选择')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div id="y_axial_2">
                <select id="c-y_axial_2" data-rule="required" class="form-control " name="row[y_axial_2]">
                    <option  value="">请选择</option>
                    {foreach $fieldsEditList as $k=>$v}
                    <option  value="{$v['key']}" {if($v['key'] == $row['y_axial_2'])} selected {/if}>{$v['name']}</option>
                    {/foreach}
                </select>
            </div>
        </div>
    </div>

    <div class="form-group">
        <label for="c-name" class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required; length(~30)" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
        </div>
    </div>
<!--    <div class="form-group">
        <label for="c-table" class="control-label col-xs-12 col-sm-2">{:__('Table')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-table" data-rule="required; length(5~30)" class="form-control" name="row[table]" readonly="" type="text" value="{$row.table}">
        </div>
    </div>-->
<!--    <div class="form-group">
        <label for="c-diyname" class="control-label col-xs-12 col-sm-2">{:__('Diyname')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-diyname" data-rule="required;diyname" class="form-control" name="row[diyname]" type="text" value="{$row.diyname|htmlentities}" data-tip="用于伪静态规则中[:diyname]替换">
        </div>
    </div>-->
    <div class="form-group">
        <label for="c-title" class="control-label col-xs-12 col-sm-2">{:__('简介')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text" value="{$row.title|htmlentities}">
        </div>
    </div>


    <!--    坐标轴最小间隔大小-->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('min_interval')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-min_interval" class="form-control" name="row[min_interval]" type="number" step="any" min="0" data-rule="" value="{$row.min_interval|htmlentities}">
        </div>
    </div>

    <!--    坐标轴最大间隔大小-->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('max_interval')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-max_interval" class="form-control" name="row[max_interval]" type="number" step="any" min="0" data-rule="" value="{$row.max_interval|htmlentities}">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:Form::radios("row[status]", $statusList, $row['status'])}
        </div>
    </div>

    <!--权重-->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('weigh')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-weigh" class="form-control" name="row[weigh]" type="number" step="1" min="0" data-rule="required;digits;integer;range(0~)" value="{$row.weigh|htmlentities}">
        </div>
    </div>

    <!--    会员价格-->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Membership_price')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-membership_price" class="form-control" name="row[membership_price]" type="number" step="any" min="0" data-rule="required;range(0~)" value="{$row.membership_price|htmlentities}">
        </div>
    </div>
    <!--    会员时长-->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Membership_duration')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-membership_duration" class="form-control" name="row[membership_duration]" type="number" step="1" min="0" data-rule="required;digits;integer;range(0~)" value="{$row.membership_duration|htmlentities}">
        </div>
    </div>


    <!--创建时间-->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Createtime')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-createtime" data-rule="required" min="0" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[createtime]" type="text" value="{:$row.createtime?datetime($row.createtime):''}">
        </div>
    </div>


    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
